package com.neu.af.dataFilter.mapper;

import com.neu.af.common.base.BaseMapper;
import com.neu.af.dataFilter.entity.AbData;
import com.neu.af.dataFilter.entity.AbDataExample;
import com.neu.af.dataFilter.entity.Data;
import com.neu.af.dataFilter.entity.pojo.RankAlarmCount;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

@Repository
public interface AbDataMapper extends BaseMapper<String, AbData> {
    String getMaxId();
    String getMinCreateTimeByTagName(String tagName);


    int countByExample(AbDataExample example);

    int deleteByPrimaryKey(String id);

    List<AbData> selectByExample(AbDataExample example);

    AbData selectByPrimaryKey(String id);

    int updateByPrimaryKey(AbData record);

    List<AbData> selectByNameAndTime(Data data);

    int delete3000();

    List<Map> sumClassByWeek(Map<String, Object> map);
    List<Map> sumTagByWeek(Map<String, Object> map);
    List<Map> sumClassByDay(Map<String, Object> map);

    List<AbData> getAlarmClassByCreateTime(int type, int alarmClass);

    List<AbData> getAlarmClassById(@Param("id") int id, @Param("type") int type, @Param("alarmClass") int alarmClass, @Param("datetime") String datetime);

    List<RankAlarmCount> getRankData();

    List<AbData> getAlarmClass(@Param("id") int id, @Param("datetime")String datetime);

    List<AbData> getClassOneAlarmByCreateTime();

    List<AbData> getClassOneAlarm(@Param("id") int id, @Param("datetime")String datetime);

    List<AbData> getAlarmClassByGroup(@Param("alarmGroup")String alarmGroup,@Param("id") int id,@Param("datetime")String datetime);

    List<String> getAlarmName();

    Timestamp getMaxCreatTimeByTagName(String tag_name);
}
